package com.atguigu.tingshu.user.factory.impl;

import com.atguigu.tingshu.user.factory.StrategyFactory;
import com.atguigu.tingshu.user.strategy.ItemTypeStrategy;
import com.atguigu.tingshu.user.strategy.impl.AlbumStrategy;
import com.atguigu.tingshu.vo.user.UserPaidRecordVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;


@Service
public class StrategyFactoryImpl implements StrategyFactory {

    @Autowired
    private Map<String, ItemTypeStrategy> strategyMap;

    @Override
    public ItemTypeStrategy getStrategy(String itemType) {

        if (strategyMap.containsKey(itemType)) {
            return strategyMap.get(itemType);
        }

        return null;
    }
}
